1. Field of the Invention
This invention relates to traffic policing in communication networks, and more in particular to handling timer and policing parameter rollovers.
2. Description of the Related Art
Various communication technologies exist for transferring data across a network or between a sender and receiver. Some communication technologies may provide for the creation of one or more communication channels or paths. In some communication technologies, data may pass from source to destination through one or more switches or routers. In some applications, it may desirable to limit or police the rate at which data may flow through a particular connection or channel. For example, in broadband communication networks where multiple communication channels are supported, it may be desirable to limit a channel to a particular data rate or bandwidth so that all channels may have a certain quality of service (QoS).
A network device, such as a switch, may provide traffic policing functionality to determine whether communications conform to an allocated bandwidth for each channel handled by the network device. The term “cell” is used herein to refer to any type of data unit, datagram, packet, or other data configuration communicated as a unit through a network. Traffic policing may involve monitoring the amount of data or the number of cells received (e.g. by a switch) during a period of time. If too much data or too many cells are received, some of the cells may be dropped or flagged as non-conforming.
In some traffic policing devices an allowed arrival time or theoretical arrival time may be maintained for each channel. The allowed/theoretical arrival time may be set to determine if data units are arriving too fast (e.g. too closely spaced). If a data unit (e.g. cell) arrives before the allowed/theoretical arrival time, then it may be discarded or flagged as non-conforming. If the data unit arrives after the allowed/theoretical arrival time, then it is passed on and the allowed/theoretical arrival time is incremented.
The traffic policing device may employ one or more counters or timers to track the actual arrival time of data units. For each channel, the traffic policing device may compare the actual arrival time to the allowed/theoretical arrival time. The timer or counter may have a certain bit width and the allowed/theoretical arrival time may be stored as a value having the same bit width as the timer or counter. For example, a 32-bit counter may be used for the timer to track actual arrival times. The allowed/theoretical arrival time may be stored as a 32-bit value.
When the counter reaches its highest value (e.g. FFFFFFFFh for a 32-bit counter), it rolls over and continues from zero. Similarly, the allowed/theoretical arrival time may rollover when it is incremented beyond its maximum value. These rollovers may cause errors in traffic policing if not accounted for. For example, if the allowed/theoretical arrival time value for a channel is large, for example FFFFFFFAh, and the timer counter rolls over, then the arrival time of a data unit may appear small, for example 000000005h. When the arrival time is compared to the allowed/theoretical arrival time, if rollover is not accounted for, the arrival time will appear to be less than the allowed/theoretical arrival time indicating that the data unit arrived too early (when in fact, in this example, it arrived eleven clocks after the allowed/theoretical arrival time). Similarly, if the allowed/theoretical arrival time is incremented beyond its max value so that it rolls over and a data unit arrives before the arrival time counter rolls over, it may appear that the data unit is conforming (since the arrival time appears to be greater than the allowed/theoretical arrival time), when in fact the data unit may have arrived too early.
In some communications systems, the network device, switch, router, etc. that is performing a traffic policing function may be configured to handle a large number of channels. For example, a switch may handle thousands of different channels. The switch may store and maintain a different allowed/theoretical arrival time and other traffic parameters for each channels. The allowed/theoretical arrival time may roll over independently for each channel. Also, a roll over of the arrival time counter may effect all of the channels at once. The more channels handled by a device, the more difficult it may be to account for roll overs of the arrival time counter and the allowed/theoretical arrival time for each channel.